package ws;

import org.apache.cxf.feature.LoggingFeature;

import javax.xml.ws.Endpoint;

public class WsServer {
    public static void main(String[] args) {
        // START SNIPPET: publish
        System.out.println("Starting Server");
        HelloWorldImpl implementor = new HelloWorldImpl();
        String address = "http://localhost:9000/helloWorld";
        Endpoint.publish(address, implementor, new LoggingFeature());
        // END SNIPPET: publish

// 或者使用以下方式进行，可以更多的配置
//        HelloWorldImpl implementor = new HelloWorldImpl();
//        JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
//        svrFactory.setServiceClass(HelloWorld.class);
//        svrFactory.setAddress("http://localhost:9000/helloWorld");
//        svrFactory.setServiceBean(implementor);
//        svrFactory.create();
    }
}
